luci-app-attendedsysupgrade: avoid redirects, handle redirect errors
authorEric Fahlgren <[email protected]>
Thu, 29 May 2025 15:51:14 +0000 (08:51 -0700)
committerPaul Donald <[email protected]>
Sat, 7 Jun 2025 14:35:52 +0000 (17:35 +0300)
commitb98b525e165e5242627f515dfce8530cff7cbb9a
treebfb1c22f48a11b09ae38cfeba8c485e6e0a768bc
parente6b26d1e07c41dfd520a2e8ef67ec14b6118f288
luci-app-attendedsysupgrade: avoid redirects, handle redirect errors

When users add an extraneous slash to the server url, then the ASU
server redirects GET requests.  But, this causes an error on POST
requests as the ASU server does not redirect those, so the LuCI
client failed inappropriately with an unhandled error.

Fix both of these by first trimming trailing slashes from the server
url as it is loaded to avoid the redirects.  Then, also handle all
unexpected responses, instead of just a select few.

Links: efahl/owut@724c990d6cc0
Signed-off-by: Eric Fahlgren <[email protected]>
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js